class Result<T> {
  final T? data;
  final String? error;

  Result._({this.data, this.error});

  static Result<T> ok<T>(T data) => Result._(data: data);
  static Result<T> fail<T>(String error) => Result._(error: error);

  bool get isOk => error == null;
}